import 'package:flutter/material.dart';
import 'package:flutterdemo/0demo/ui/dismissable/slide_remove/slide_remove_widget.dart';

import 'slide_button.dart';

class SlideRemovePage extends StatefulWidget {
  @override
  _SlideRemovePageState createState() => _SlideRemovePageState();
}

class _SlideRemovePageState extends State<SlideRemovePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("侧滑删除list item"),
      ),
      body: ListView(
        children: [
          SlideButton(
            buttons: [
              Container(
                color: Colors.red,
                height: 100,
              ),
              Container(
                color: Colors.red,
                height: 100,
              ),
            ],
            singleButtonWidth: 30,
            child: Container(
              height: 100,
              color: Colors.green,
            ),
            index: 0,
            canDragNumber: 0,
          ),
          SizedBox(height: 20),
          SlideRemoveWidget(
            itemChild: Container(
              color: Colors.green,
            ),
            slideChild: Container(
              color: Colors.red,
            ),
            itemHeight: 100,
          ),
          SizedBox(height: 20),
          SlideRemoveWidget(
            itemChild: Container(
              color: Colors.green,
            ),
            slideChild: Container(
              color: Colors.red,
            ),
            itemHeight: 100,
          ),
          SizedBox(height: 20),
          SlideRemoveWidget(
            itemChild: Container(
              color: Colors.green,
            ),
            slideChild: Container(
              color: Colors.red,
            ),
            itemHeight: 100,
          ),
        ],
      ),
    );
  }
}
